﻿var Sid=0;
var desc="";
function Feedback(sid)
{
    Sid=sid;
    if(__P_M==""){$Login$();return;}
    showProgressBar(false,true);
    $("$divIput$").style.display = "none";   
    
    var obj = {}
    $ShowMessageBox$(Title,body,obj,webFailure);
}
function webFailure()
{
    $EndMessageBox$();
}
function FB()
{
    desc=$("tareaFeedback").value.replace(/<script[^>]*>([\u0001-\uFFFF]*?)<\/script>/gi,"");
    if(desc=="")
    {
        return;
    }
    if(desc.length>1000)
    {
        desc=desc.substring(0,999);
    }
    
    WebServices.My.AddTToSDesc(Sid,desc,onsuccFB);
}
function onsuccFB(result)
{
    if(result.State)
    {
       $(Sid.toString()).innerHTML=$("TToSDescItem").innerHTML.replace(/\$TToSDesc\$/gi,EncodeMessage(desc));
    }
    $EndMessageBox$();
}